package com.icinfo.cloud.provider.peripheralinterface.datareport.controller;

import com.icinfo.cloud.provider.common.constant.Constant;
import com.icinfo.cloud.provider.peripheralinterface.datareport.service.IDataReportService;
import com.icinfo.cloud.provider.punish.common.datareport.dto.CollectReportDataDto;
import com.icinfo.framework.common.web.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Desc 描述
 * @Author mahan
 * @Date 2023/3/30
 */
@RestController
@RequestMapping("/peripheralInterface/data/report")
public class DataReportController {

	@Resource
	private IDataReportService dataReportService;

	/**
	 * 上报人社数据
	 * @param reportDataDto
	 * @return
	 */
	@PostMapping("/collectReportData")
	public Result<String> collectReportData(@RequestBody CollectReportDataDto reportDataDto) {
		dataReportService.caseDataReport(reportDataDto);
		return Result.success(Constant.STRING_GET_SUCCESS);
	}

	/**
	 * 查询人社历史数据，上报
	 * @return
	 */
	@PostMapping("/collectRsHisData")
	public Result<Integer> collectRsHisData() {
		return Result.success(dataReportService.collectRsHisData());
	}
}
